package com.axend.aerosense.common.connect.ble.handler;

import com.axend.aerosense.common.connect.bean.BleMsgEntity;
import com.axend.aerosense.common.connect.bean.BleMsgTag;
import com.axend.aerosense.common.connect.bean.BleNotifyEntity;
import com.axend.aerosense.common.connect.ble.AbstractBleMsgProcessor;

/**
 * 设置设备wifi账号与密码（通讯板）
 */
public class BleDeviceWifiHandler extends AbstractBleMsgProcessor {

    @Override
    protected BleMsgTag getMsgTag() {
        return BleMsgTag.SET_NETWORK_INFO;
    }

    @Override
    public byte[] write(BleMsgEntity bleMsgEntity) {
        Object body = bleMsgEntity.getBody();
        if (body instanceof String) {
            String data = "(" + body.toString() + ")";
            bleMsgEntity.setBody(data);
        }
        return super.write(bleMsgEntity);
    }

}
